home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / gcc / geninline_920614.lha / inline-2.0 / translator.h < prev    next >
C/C++ Source or Header  |  1992-06-14  |  1KB  |  45 lines

  1. #ifndef _INLINE_TRANSLATOR_H
  2. #define _INLINE_TRANSLATOR_H
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. __BEGIN_DECLS
  8.  
  9. #ifndef BASE_EXT_DECL
  10. #define BASE_EXT_DECL extern struct Library * TranslatorBase;
  11. #endif
  12. #ifndef BASE_PAR_DECL
  13. #define BASE_PAR_DECL
  14. #define BASE_PAR_DECL0 void
  15. #endif
  16. #ifndef BASE_NAME
  17. #define BASE_NAME TranslatorBase
  18. #endif
  19.  
  20. static __inline LONG 
  21. Translate (BASE_PAR_DECL STRPTR inputString,long inputLength,STRPTR outputBuffer,long bufferSize)
  22. {
  23.   BASE_EXT_DECL
  24.   register LONG  _res  __asm("d0");
  25.   register struct Library *a6 __asm("a6") = BASE_NAME;
  26.   register STRPTR a0 __asm("a0") = inputString;
  27.   register long d0 __asm("d0") = inputLength;
  28.   register STRPTR a1 __asm("a1") = outputBuffer;
  29.   register long d1 __asm("d1") = bufferSize;
  30.   __asm __volatile ("jsr a6@(-0x24)"
  31.   : "=r" (_res)
  32.   : "r" (a6), "r" (a0), "r" (d0), "r" (a1), "r" (d1)
  33.   : "a0","a1","d0","d1");
  34.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;
  35.   return _res;
  36. }
  37. #undef BASE_EXT_DECL
  38. #undef BASE_PAR_DECL
  39. #undef BASE_PAR_DECL0
  40. #undef BASE_NAME
  41.  
  42. __END_DECLS
  43.  
  44. #endif /* _INLINE_TRANSLATOR_H */
  45.